var t = new(require("../../../utils/http.js").HTTP);
Page({
  data: {
    zhongdian: !0,
    previousPage: 1,
    total: 1
  },
  onLoad: function (t) {
    var a = wx.getStorageSync("user");
    console.log(t, "options");
    this.setData({
        id: t.id,
        user: a
      }),
      2 == t.id && this.purpose()
  },
  purpose: function () {
    var a = this;
    t.request({
      url: "https://www.qlsyyun.com:3030/channel",
      data: {
        arr: 1,
        bumen: a.data.user[1]
      }
    }).then((function (s) {
      a.setData({
          pageDown: s.data[0].num
        }),
        t.request({
          url: "https://www.qlsyyun.com:3030/channel/detail",
          data: {
            arr: 1,
            total: a.data.total,
            bumen: a.data.user[1]
          }
        }).then((function (t) {
          0 == t.data.length ? a.setData({
            show: !1
          }) : a.setData({
            clients: t.data,
            show: !0
          })
        }))
    }))
  },
  previousPage: function () {
    this.data.previousPage > 1 && (this.setData({
      total: this.data.total - 1,
      previousPage: this.data.total - 1
    }), 2 == this.data.id && this.purpose(), wx.pageScrollTo({
      scrollTop: 0
    }))
  },
  pageDown: function () {
    this.data.previousPage < this.data.pageDown && (this.setData({
      total: this.data.total + 1,
      previousPage: this.data.total + 1
    }), 2 == this.data.id && this.purpose(), wx.pageScrollTo({
      scrollTop: 0
    }))
  }
});